package com.zrentech.order.ui;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;

import com.zrentech.order.R;

public class SplashscreenActivity extends Activity {

	private static final String TAG = "SplashActivity";
	

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		//
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);

		setContentView(R.layout.splash);
		
		//
		AlphaAnimation anim = new AlphaAnimation(0.1f, 1.0f);
		anim.setDuration(3000);
		try {
			this.findViewById(R.id.ImageView_Logo).startAnimation(anim);
		} catch (Exception e) {
			e.printStackTrace();
		}
		anim.setAnimationListener(new AnimationListener() {
			@Override
			public void onAnimationStart(Animation animation) {	}
			
			@Override
			public void onAnimationRepeat(Animation animation) { }
			
			@Override
			public void onAnimationEnd(Animation animation) {
				MenuActivity.launch(SplashscreenActivity.this);
				SplashscreenActivity.this.finish();
			}
		});
	}
}